package com.mt.enums;

import lombok.Getter;

/**
 * @author Wang
 * @Description 点赞状态枚举
 * @date 2020/12/2-14:45
 */
@Getter
public enum  LikeStatus {
    LIKE(1, "点赞"),
    UNLIKE(0, "未点赞");

    private Integer code;

    private String msg;

    LikeStatus(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static int TypeCode(LikeStatus listType) {
        for (LikeStatus like :LikeStatus.values()){
            if (like.getMsg()==listType.getMsg()) {
                return like.getCode();
            }
        }
        return -1;
    }

    public static String TypeName(LikeStatus listType) {
        for (LikeStatus like :LikeStatus.values()){
            if (like.getCode().equals(listType.getCode())) {
                return like.getMsg();
            }
        }
        return null;
    }
}
